import { createRouter, createWebHashHistory } from 'vue-router'

console.log(import.meta.env.BASE_URL)
const router = createRouter({
  // history: createWebHistory(import.meta.env.BASE_URL),
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      redirect: 'home'
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('../views/home/home.vue'),
      meta: {
        title: '宏源旅途'
      }
    },
    {
      path: '/favor',
      name: 'favor',
      component: () => import('../views/favor/favor.vue'),
      meta: {
        title: '收藏'
      }
    },
    {
      path: '/message',
      name: 'message',
      component: () => import('../views/message/message.vue'),
      meta: {
        title: '消息',
        hideTabBar: true //隐藏下方tabbar
      }
    },
    {
      path: '/order',
      name: 'order',
      component: () => import('../views/order/order.vue'),
      meta: {
        title: '订单'
      }
    },
    {
      path: '/userInfo',
      name: 'userInfo',
      component: () => import('../views/userInfo/userInfo.vue'),
      meta: {
        title: '我的信息',
        hideNavBar: true,//顶部导航
        hideTabBar: true//底部tabbar
      }
    },
    {
      path: '/city',
      name: 'city',
      component: () => import('../views/city/choseCity.vue'),
      meta: {
        title: '选择位置',
        hideNavBar: true,
        hideTabBar: true
      }
    },
    {
      path: '/search',
      name: 'search',
      component: () => import('../views/search/search.vue'),
      meta: {
        title: '选择位置',
        hideNavBar: true,
        hideTabBar: true
      }
    },
    {
      path: '/detail',
      name: 'detail',
      component: () => import('../views/detail/detail.vue'),
      meta: {
        hideNavBar: true,
        hideTabBar: true
      }
    },
  ]
})

export default router
